<?php
/**
 * 播放图片模型层基类
 * 
 * @copyright 	Copyright (c) 2011 thinkapk.com All rights reserved.
 * @package 	ThinkAPK_Model
 * @link 		http://www.thinkapk.com/
 * @author 		richie <richbossman@163.com>
 * @version 	$Id: RelationImgModel.class.php 7482 2011-05-19 10:12:51Z richie $
 * 
 */
class RelationImgModel extends CommonModel {
	
	/**
	 * 取得指定类型的播放广告
	 *
	 * @param int $pid
	 * @param string $type
	 * @param int $limit
	 * @return array
	 */
	function get($type='', $pid=0, $limit=10){
		$map['type'] = $type;
		if($pid) $map['pid'] = $pid;
		$row = $this->where($map)->field('id,title,src,is_text,title_prefix,link,sort_order,add_time')->order('sort_order ASC')->limit($limit)->findAll();
		if($row){
			foreach ($row as $key=>$res){
				$row[$key]['src'] = $this->getImagePath($res['src']);
			}
		}
		return $row;
	}
}
?>